Skip to content

fix(ci): grant the secret-scanner reusable its required job permissions#72

Merged
hyperpolymath merged 3 commits into
mainfrom
fix/secret-scanner-permissions-signed
Jul 21, 2026
Merged

fix(ci): grant the secret-scanner reusable its required job permissions#72
hyperpolymath merged 3 commits into
mainfrom
fix/secret-scanner-permissions-signed

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Every Secret Scanner run in this repo has been ending in startup_failure — meaning secret scanning has never actually executed here.

Root cause

A called reusable workflow may only request permissions equal to or more restrictive than its caller. This is enforced when the workflow file is parsed, before a runner is allocated — which is why it surfaces as startup_failure with no logs and no annotations.

secret-scanner-reusable.yml declares this on its gitleaks job:

permissions:
  contents: read
  pull-requests: write   # gitleaks-action posts the PR summary comment
  actions: read          # workflow-run metadata / PR-files endpoint

This caller granted only the file-level permissions: contents: read, so the reusable was asking for more than the caller had, and GitHub refused the run outright.

Evidence

Two repos pinning the identical reusable SHA behave differently based only on this block: modshells (grants the superset) runs fine; verisimdb (does not) startup_failures. Estate-wide, 176 callers grant it and run; 26 did not and were all dead.

Fix

Grant the superset at job level — byte-identical to the canonical template. No SHA pin is changed, so the scanned content and supply-chain posture are unaffected; this only lets the existing pinned scanner start.

Verified

On hyperpolymath/vext, this exact change moved Secret Scanner from startup_failure to success, with gitleaks, rust-secrets and shell-secrets all allocating runners and passing.

🤖 Generated with Claude Code

The scan job calls secret-scanner-reusable.yml, whose gitleaks job declares
pull-requests: write (PR summary comment) and actions: read (workflow-run
metadata) at job level. A called reusable workflow may only request
permissions equal to or more restrictive than its caller, and this caller
granted only the file-level contents: read — so GitHub refused the run at
parse time. Every Secret Scanner run ended in startup_failure, meaning
secret scanning has never actually executed in this repo.

Grants the superset at job level, matching the canonical template and the
176 estate repos whose scanner already runs. No SHA pin is changed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hyperpolymath and others added 2 commits July 21, 2026 06:33
secret-scanner-reusable.yml deliberately retired TruffleHog as redundant
("gitleaks provides sufficient coverage at lower cost" — see the reusable's
header). The inline job survived here, fails, and turns the whole workflow red
even when gitleaks, rust-secrets and shell-secrets all pass — so the repo keeps
emitting ci_activity notifications after the startup_failure is fixed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath
hyperpolymath merged commit 5d438f1 into main Jul 21, 2026
14 of 17 checks passed
@hyperpolymath
hyperpolymath deleted the fix/secret-scanner-permissions-signed branch July 21, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant